home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / kiss-0.11 / kiss-0 / kiss / src / doquit.c < prev    next >
C/C++ Source or Header  |  1995-03-23  |  411b  |  21 lines

  1. #include "kiss.h"
  2.  
  3. int doquit (Stringstack s)
  4. {
  5.     if (s.nstr > 2)
  6.     return (warning ("Bad commandline.\n"
  7.              "Usage: exit [exitstatus]\n"
  8.              "Where:\n"
  9.              "    exitstatus: (optional) return value; "
  10.                     "default: exit with result\n"
  11.              "    of last child process\n"));
  12.  
  13.     if (s.nstr > 1)
  14.     exit (atoi (s.str [1]));
  15.     else
  16.     {
  17.     exit (laststatus);
  18.     return (0);    /* to satisfy return value */
  19.     }
  20. }
  21.